const cloud = require('wx-server-sdk')

cloud.init({
    env:"agriculture-4g9roniha194f9d1"
})
const db = cloud.database();
// 云函数入口函数
exports.main = async (event, context) => {
    var num = event.num;
    var page = event.page;
    var label = event.label;
    var area = event.area;
    var type = event.type;
  return await db.collection('land').where({
      'location.address':db.RegExp({
        regexp:'^.*'+area,
      }),
      label:db.RegExp({
        regexp:'^.*'+label,
      }),
      type:db.RegExp({
        regexp:'^.*'+type,
      }),
    }).skip(page).limit(num).get()

}